import moment from 'moment';
/*eslint-disable */
// mock data

const visitData = [];
const beginDay = new Date().getTime();
const fakeY = [7, 5, 4, 2, 4, 7, 5, 6, 5, 9, 6, 3, 1, 5, 3, 6, 5];

for (let i = 0; i < fakeY.length; i += 1)
    visitData.push({
        x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
        y: fakeY[i]
    });

const visitData2 = [];
const fakeY2 = [1, 6, 4, 8, 3, 7, 2];

for (let i = 0; i < fakeY2.length; i += 1)
    visitData2.push({
        x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
        y: fakeY2[i]
    });

const salesData = [];

for (let i = 0; i < 12; i += 1)
    salesData.push({
        x: `${i + 1}月`,
        y: Math.floor(Math.random() * 1000) + 200
    });

const searchData = [];

for (let i = 0; i < 50; i += 1)
    searchData.push({
        index: i + 1,
        keyword: `搜索关键词-${i}`,
        count: Math.floor(Math.random() * 1000),
        range: Math.floor(Math.random() * 100),
        status: Math.floor((Math.random() * 10) % 2)
    });

const salesTypeData = [
    {
        x: '家用电器',
        y: 4544
    },
    {
        x: '食用酒水',
        y: 3321
    },
    {
        x: '个护健康',
        y: 3113
    },
    {
        x: '服饰箱包',
        y: 2341
    },
    {
        x: '母婴产品',
        y: 1231
    },
    {
        x: '其他',
        y: 1231
    }
];
const salesTypeDataOnline = [
    {
        x: '家用电器',
        y: 244
    },
    {
        x: '食用酒水',
        y: 321
    },
    {
        x: '个护健康',
        y: 311
    },
    {
        x: '服饰箱包',
        y: 41
    },
    {
        x: '母婴产品',
        y: 121
    },
    {
        x: '其他',
        y: 111
    }
];
const salesTypeDataOffline = [
    {
        x: '家用电器',
        y: 99
    },
    {
        x: '个护健康',
        y: 188
    },
    {
        x: '服饰箱包',
        y: 344
    },
    {
        x: '母婴产品',
        y: 255
    },
    {
        x: '其他',
        y: 65
    }
];
const offlineData = [];

for (let i = 0; i < 10; i += 1)
    offlineData.push({
        name: `门店${i}`,
        cvr: Math.ceil(Math.random() * 9) / 10
    });

const offlineChartData = [];

for (let i = 0; i < 20; i += 1)
    offlineChartData.push({
        x: new Date().getTime() + 1000 * 60 * 30 * i,
        y1: Math.floor(Math.random() * 100) + 10,
        y2: Math.floor(Math.random() * 100) + 10
    });

const radarOriginData = [
    {
        name: '个人',
        ref: 10,
        koubei: 8,
        output: 4,
        contribute: 5,
        hot: 7
    },
    {
        name: '团队',
        ref: 3,
        koubei: 9,
        output: 6,
        contribute: 3,
        hot: 1
    },
    {
        name: '部门',
        ref: 4,
        koubei: 1,
        output: 6,
        contribute: 5,
        hot: 7
    }
]; //

const radarData = [];
const radarTitleMap = {
    ref: '引用',
    koubei: '口碑',
    output: '产量',
    contribute: '贡献',
    hot: '热度'
};
radarOriginData.forEach(item => {
    Object.keys(item).forEach(key => {
        if (key !== 'name')
            radarData.push({
                name: item.name,
                label: radarTitleMap[key],
                value: item[key]
            });
    });
});
export const getFakeChartData = {
    visitData,
    visitData2,
    salesData,
    searchData,
    offlineData,
    offlineChartData,
    salesTypeData,
    salesTypeDataOnline,
    salesTypeDataOffline,
    radarData
};
const titles = ['Alipay', 'Angular', 'Ant Design', 'Ant Design Pro', 'Bootstrap', 'React', 'Vue', 'Webpack'];
const avatars = [
    'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png', // Alipay
    'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png', // Angular
    'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png', // Ant Design
    'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png', // Ant Design Pro
    'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png', // Bootstrap
    'https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png', // React
    'https://gw.alipayobjects.com/zos/rmsportal/ComBAopevLwENQdKWiIn.png', // Vue
    'https://gw.alipayobjects.com/zos/rmsportal/nxkuOJlFJuAUhzlMTCEe.png'
];
const avatars2 = [
    'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
    'https://gw.alipayobjects.com/zos/rmsportal/cnrhVkzwxjPwAaCfPbdc.png',
    'https://gw.alipayobjects.com/zos/rmsportal/gaOngJwsRYRaVAuXXcmB.png',
    'https://gw.alipayobjects.com/zos/rmsportal/ubnKSIfAJTxIgXOKlciN.png',
    'https://gw.alipayobjects.com/zos/rmsportal/WhxKECPNujWoWEFNdnJE.png',
    'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png',
    'https://gw.alipayobjects.com/zos/rmsportal/psOgztMplJMGpVEqfcgF.png',
    'https://gw.alipayobjects.com/zos/rmsportal/ZpBqSxLxVEXfcUNoPKrz.png',
    'https://gw.alipayobjects.com/zos/rmsportal/laiEnJdGHVOhJrUShBaJ.png',
    'https://gw.alipayobjects.com/zos/rmsportal/UrQsqscbKEpNuJcvBZBu.png'
];
export const getNotice = [
    {
        id: 'xxx1',
        title: titles[0],
        logo: avatars[0],
        description: '那是一种内在的东西，他们到达不了，也无法触及的',
        updatedAt: new Date(),
        member: '科学搬砖组',
        href: '',
        memberLink: ''
    },
    {
        id: 'xxx2',
        title: titles[1],
        logo: avatars[1],
        description: '希望是一个好东西，也许是最好的，好东西是不会消亡的',
        updatedAt: new Date('2017-07-24'),
        member: '全组都是吴彦祖',
        href: '',
        memberLink: ''
    },
    {
        id: 'xxx3',
        title: titles[2],
        logo: avatars[2],
        description: '城镇中有那么多的酒馆，她却偏偏走进了我的酒馆',
        updatedAt: new Date(),
        member: '中二少女团',
        href: '',
        memberLink: ''
    },
    {
        id: 'xxx4',
        title: titles[3],
        logo: avatars[3],
        description: '那时候我只会想自己想要什么，从不想自己拥有什么',
        updatedAt: new Date('2017-07-23'),
        member: '程序员日常',
        href: '',
        memberLink: ''
    },
    {
        id: 'xxx5',
        title: titles[4],
        logo: avatars[4],
        description: '凛冬将至',
        updatedAt: new Date('2017-07-23'),
        member: '高逼格设计天团',
        href: '',
        memberLink: ''
    },
    {
        id: 'xxx6',
        title: titles[5],
        logo: avatars[5],
        description: '生命就像一盒巧克力，结果往往出人意料',
        updatedAt: new Date('2017-07-23'),
        member: '骗你来学计算机',
        href: '',
        memberLink: ''
    }
];
export const getActivities = [
    {
        id: 1,
        title: '关于2018年<a>J.D.Power SSI</a>调研的专项工作通知',
        content: '关于2018年J.D.Power SSI调研的专项工作通知(调研城市经销商必须执行)',
        updatedAt: new Date('2018-04-01')
    },
    {
        id: 2,
        title: '关于瑞虎3x产品库存限时消化及上牌的通知',
        content:
            '为满足国标切换要求，针对<a>瑞虎3x车型</a>（SQR7150J692、 SQR7150J69T2现需完成限时销售及上牌工作：车型为SQR7150J692、 SQR7150J69T2且合格证日期在2017年7月19日之前的车辆需于2018年3月1日前完成销售及上牌工作。',
        updatedAt: new Date('2018-02-01')
    },
    {
        id: 3,
        title: 'SHT-201712-39关于加强冬季PDI执行的通知',
        content: 'SHT-201712-39关于加强冬季PDI执行的通知',
        updatedAt: new Date('2017-12-10')
    },
    {
        id: 4,
        title: '关于瑞虎3x产品库存限时消化及上牌的通知',
        content: '为满足国标切换要求，针对<a>瑞虎3x车型</a>（SQR7150J692、 SQR7150J69T2）现需完成限时销售及上牌工作。详细见附件。',
        updatedAt: new Date('2017-11-31')
    },
    {
        id: 5,
        title: 'SHT-201711-58关于瑞虎3x脚制动开关维修方案的通知',
        content: 'SHT-201711-58关于<a>瑞虎3x</a>脚制动开关维修方案的通知',
        updatedAt: new Date('2017-11-20')
    },
    {
        id: 6,
        title: '关于<a>艾瑞泽5Sport</a>商超展示工作安排的通知',
        content: '关于艾瑞泽5Sport商超展示工作安排的通知',
        updatedAt: new Date('2017-11-01')
    }
];
export const taskList = [
    {
        title: '潜客跟进',
        link: '/crm/assignment/#/',
        details: [
            {
                title: 'H',
                count: 10
            },
            {
                title: 'A',
                count: 16
            },
            {
                title: 'B',
                count: 20
            },
            {
                title: 'C',
                count: 15
            }
        ]
    },
    {
        title: '试乘试驾预约',
        link: '/crm/testDrive/#/',
        details: [
            {
                title: '今日',
                count: 5
            },
            {
                title: '明日',
                count: 3
            },
            {
                title: '后天',
                count: 2
            }
        ]
    },
    {
        title: '待交车',
        link: '/sales/retailContract/',
        details: [
            {
                title: '奔驰V级',
                count: 1
            },
            {
                title: '奥迪S7',
                count: 2
            },
            {
                title: '奥迪Q7',
                count: 2
            }
        ]
    },
    {
        title: '保险提醒',
        link: '/sales/insurancePolicy/',
        details: [
            {
                title: '商业险到期（3个月）',
                count: 10
            },
            {
                title: '交强险到期（3个月）',
                count: 15
            }
        ]
    },
    {
        title: '在库车型（热销）',
        link: '/sales/vehicle/',
        details: [
            {
                title: '奔驰V级',
                count: 5
            },
            {
                title: '奥迪S7',
                count: 4
            },
            {
                title: '奥迪Q7',
                count: 2
            }
        ]
    },
    {
        title: '战败客户',
        link: '/crm/defeatedApplication/',
        details: [
            {
                title: '申请数',
                count: 5
            },
            {
                title: '已审批数',
                count: 4
            }
        ]
    }
];
